package com.cm.caseManagement.service.impl;

import com.cm.caseManagement.dao.CmMoveRecordMapper;
import com.cm.caseManagement.pojo.entity.CmMoveRecord;
import com.cm.caseManagement.service.ICmMoveRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cm.caseManagement.utils.DateUtils;

import java.util.List;

/**
 * 移交记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmMoveRecordServiceImpl implements ICmMoveRecordService
{
    @Autowired
    private CmMoveRecordMapper cmMoveRecordMapper;

    /**
     * 查询移交记录
     *
     * @param id 移交记录主键
     * @return 移交记录
     */
    @Override
    public CmMoveRecord selectCmMoveRecordById(Long id)
    {
        return cmMoveRecordMapper.selectCmMoveRecordById(id);
    }

    /**
     * 查询移交记录列表
     *
     * @param cmMoveRecord 移交记录
     * @return 移交记录
     */
    @Override
    public List<CmMoveRecord> selectCmMoveRecordList(CmMoveRecord cmMoveRecord)
    {
        return cmMoveRecordMapper.selectCmMoveRecordList(cmMoveRecord);
    }

    /**
     * 新增移交记录
     *
     * @param cmMoveRecord 移交记录
     * @return 结果
     */
    @Override
    public int insertCmMoveRecord(CmMoveRecord cmMoveRecord)
    {
        cmMoveRecord.setCreateTime(DateUtils.getNowDate());
        return cmMoveRecordMapper.insertCmMoveRecord(cmMoveRecord);
    }

    /**
     * 修改移交记录
     *
     * @param cmMoveRecord 移交记录
     * @return 结果
     */
    @Override
    public int updateCmMoveRecord(CmMoveRecord cmMoveRecord)
    {
        cmMoveRecord.setUpdateTime(DateUtils.getNowDate());
        return cmMoveRecordMapper.updateCmMoveRecord(cmMoveRecord);
    }

    /**
     * 批量删除移交记录
     *
     * @param ids 需要删除的移交记录主键
     * @return 结果
     */
    @Override
    public int deleteCmMoveRecordByIds(Long[] ids)
    {
        return cmMoveRecordMapper.deleteCmMoveRecordByIds(ids);
    }

    /**
     * 删除移交记录信息
     *
     * @param id 移交记录主键
     * @return 结果
     */
    @Override
    public int deleteCmMoveRecordById(Long id)
    {
        return cmMoveRecordMapper.deleteCmMoveRecordById(id);
    }
}
